<?php 
/*
# ------------------------------------------------------------------------
# JA Job Board Package
# ------------------------------------------------------------------------
# Copyright (C) 2004-2010 JoomlArt.com. All Rights Reserved.
# @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
# Author: JoomlArt.com
# Websites: http://www.joomlart.com - http://www.joomlancers.com.
# ------------------------------------------------------------------------
*/
defined('_JEXEC') or die('Restricted access');
?>
<style title="v">
.is_required_mark {
	color:red;
}
</style>
<form action="#" method="post" name="adminForm" enctype="multipart/form-data" id="adminForm">

<div class="col100">
	<?php 
	echo $this->menu_User();
	// Set, get the variable
	
	?>
        	<br/>
	<fieldset class="adminform">	
		<legend><?php echo JText::_( 'IMPORT LOG' );?></legend>
		<table class="admintable" width="100%" border="1px" style="border-collapse:collapse;  border-color:#CCCCCC" cellspacing="2" cellpadding="4">
		<tr>
			<td>
			<?php
			
			global $jbconfig;			
			
			$filename = JPATH_SITE.$jbconfig['general']->get('upload_folder',DS.'images'.DS.'stories'.DS.'jbuploads').DS.'import_log.txt';			
			
			if (isset($_REQUEST['clear_log'])) {
			
				if (file_exists($filename)) {
					unlink ($filename);
				}
			}
						
			// READ THE LOG
			if (file_exists($filename)) {
			
				$size = filesize($filename);
			
				if ($size > 0) {
					$fp = fopen ($filename, 'r');
			
					$log = fread($fp, filesize($filename));
					fclose($fp);
				} else {
					$log = JText::_("THE LOG IS EMPTY");
				}
			
			} else {
				$log = JText::_("THE LOG IS EMPTY");
			}			
			?><br>
			<input type="submit" name="clear_log" value="<?php echo JText::_("CLEAR LOG"); ?>"/><br><br>
			<textarea rows="25" cols="100" style="width:99%"><?php echo htmlentities($log); ?></textarea>
			</td>
		</tr>
	   </table>
	</fieldset>
</div>
<div class="clr"></div>

<input type="hidden" name="option" value="com_jajobboard" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="tab" value="logs" />
<input type="hidden" name="view" value="jaxmlimport" />
</form>